Although the Internet and, more specifically, the world wide web (or just “the web”) is a very useful tool for distributing information, the web may be used as an information gathering tool as well. A typical server-side information gathering session involves a web server and an application server. In a representative information gathering session, a Hyper-Text Markup Language (HTML) form is served by the web server to gather user input. Once received by a web server, the user input may be submitted to a common gateway interface (CGI) script or a servlet program running on the application server. In the case where a servlet program receives the input, the servlet program must parse the input into input parameters and extract the value of each input parameter.
For example, an input parameter named “employeeID” is defined in the following HTML code and a portion of Java code (from a corresponding servlet program) is provided to use the input parameter.
myInput.html<HTML><BODY><FORM METHOD=“post” ACTION=“/servlet/myServlet”><INPUT TYPE=“text” NAME=“employeeID” ID=“employeeID”SIZE=“8” MAXLENGTH=“8”><INPUT TYPE=“password” NAME=“password” SIZE=“8” MAXLENGTH=“8”><INPUT TYPE=“submit” NAME=“Submit” ID=“Submit”VALUE=“Submit”></FORM></BODY></HTML>myServlet.javapublic void doPost(javax.servlet.http.HttpServletRequest request,javax.servlet.http.HttpServletResponse response)throws servletException, IOException{String argEmployeeID = request.getParameter(“employeeID”);String argPassword = request.getParameter(“password”);// more code after this}
It is known that the name of the input parameter must be the same in both the HTML code and the Java code. Taken together, multiple input parameters serve as an interface (called an “input parameter interface” herein) between an HTML input file and a corresponding servlet program file. If any changes are to be made, both files need to be updated and, it is then hoped that both the HTML input file and the servlet program are free of spelling errors, etc. Furthermore, it is typical for one person, a web developer, to develop the HTML file, and another person, a Java coder, to develop the servlet program. This separation of development roles can lead to synchronization and consistency problems.